Con log:"Init support" from:"Mixin".
Repl newClass:"MixinClass".
MixinClass setParent:XClass.
(MixinClass new) setName:"Mixin".
Mixin addField:"name".
Mixin addField:"methods".
Mixin addField:"fields".

Repl methodIn:Method.
toString[
    x <- StringBuffer new.
    x append:"Method(".
    x append:(self getSelector).
    x append:")".
    ^ x toString.
]

Repl methodIn:Mixin.
initialize [
    methods <- Vector new.
    fields <- Vector new.
]

Repl methodIn:Mixin.
setName: n [
   name <- n.
   Image addNamed: self as: n.
]
Repl methodIn:Mixin.
addMethod: m[
    methods add:m.
]

Repl methodIn:Mixin.
doMethods: c [
    (Range from:0 to: (methods length)) do:[i:|| ^c value:(methods at:i)].
]

Repl methodIn:Mixin.
toString[
    x <- StringBuffer new.
    x append:"Mixin(".
    x append: name.
    x append:")".
    ^ x toString.
]